from django.urls import path, include, re_path
from . import views

# 设置应用程序命名空间
app_name = "users"
urlpatterns = [
    # http://127.0.0.1:8000/register  --与users.register等价
    path("register/", views.RegisterView.as_view(), name="register"),
    re_path('usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/', views.UsernameCountView.as_view()),
    re_path(r'mobiles/(?P<mobile>1[3-9]\d{9})/count/', views.MobileCountView.as_view()),
    path('login/', views.LoginView.as_view(), name='login'),
    # 用户退出
    path('logout/', views.LogoutView.as_view(), name='logout'),
    # 用户中心
    path('info/', views.UserInfoView.as_view(), name='info'),
]
